import json

def check_bbox_conditions(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        for line in file:
            data = json.loads(line)
            filename = data.get('filename')
            instances = data.get('detection', {}).get('instances', [])
            
            for instance in instances:
                bbox = instance.get('bbox', [])
                if len(bbox) == 4:
                    x1, y1, x2, y2 = bbox
                    if x1 > x2 or y1 > y2:
                        print(f"Invalid bbox in file {filename}: {bbox}")

# 使用文件路径调用函数
check_bbox_conditions('Meishan/annotation/Meishan_240830.jsonl')